using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;

namespace AJAXEnabledWebApplication1
{
        public class BaseEvent
        {
            private int event_user_id;
            private int event_id;
            private string event_start_date;
            private string event_end_date;
            private bool event_alarm;
            private string[] event_person_names;
            private string event_color;
            private bool event_permission;

            
            public int user_id {
                get { return event_user_id; }
                set { event_user_id = value; }
            }
            public int id
            {
                get { return event_id; }
                set { event_id = value; }
            }
            public string start_date
            {
                get { return event_start_date; }
                set { event_start_date = value; }
            }
            public string end_date
            {
                get { return event_end_date; }
                set { event_end_date = value; }
            }
            public bool alarm
            {
                get { return event_alarm; }
                set { event_alarm = value; }
            }
            public string[] person_names
            {
                get { return event_person_names; }
                set { event_person_names = value; }
            }
            public string color
            {
                get { return event_color; }
                set { event_color = value; }
            }
            public bool permission
            {
                get { return event_permission; }
                set { event_permission = value; }
            }

            public Alarm my_alarm;

            public BaseEvent(int p_uid, int p_id, string p_sd, string p_ed, bool p_alarm, string[] p_pn, string p_color, bool p_perm, int p_aid, string p_asd, string p_aed, int p_ar)
            {
                event_user_id = p_uid;
                event_id = p_id;
                event_start_date = p_sd;
                event_end_date = p_ed;
                event_alarm = p_alarm;
                event_person_names = p_pn;
                event_color = p_color;
                event_permission = p_perm;

                my_alarm = new Alarm(p_aid, p_asd, p_aed, p_ar);
            }
        }
        public class Appointment : BaseEvent
        {
            private string event_location;
            private string event_note;

            public string location
            {
                get { return event_location; }
                set { event_location = value; }
            }
            public string note
            {
                get { return event_note; }
                set { event_note = value; }
            }

            public Appointment(int p_uid, int p_id, string p_loc, string p_note, string p_sd, string p_ed, bool p_alarm, string[] p_pn, string p_color, bool p_perm, int p_aid, string p_asd, string p_aed, int p_ar)
                : base(p_uid, p_id, p_sd, p_ed, p_alarm, p_pn, p_color, p_perm, p_aid, p_asd, p_aed, p_ar)
            {
                event_location = p_loc;
                event_note = p_note;
            }
        }
        public class Birthday : BaseEvent
        {
            private string event_birth_year;

            public string birth_year
            {
                get { return event_birth_year; }
                set { event_birth_year = value; }
            }

            public Birthday(int p_uid, int p_id, string p_by, string p_sd, string p_ed, bool p_alarm, string[] p_pn, string p_color, bool p_perm, int p_aid, string p_asd, string p_aed, int p_ar)
                : base(p_uid, p_id, p_sd, p_ed, p_alarm, p_pn, p_color, p_perm, p_aid, p_asd, p_aed, p_ar)
            {
                event_birth_year = p_by;
            }
        }
        public class Event : BaseEvent
        {
            private int event_type_id;
            private string event_location;
            private string event_note;
            private string event_type_name;

            public int type_id
            {
                get { return event_type_id; }
                set { event_type_id = value; }
            }
            public string type_name
            {
                get { return event_type_name; }
                set { event_type_name = value; }
            }
            public string location
            {
                get { return event_location; }
                set { event_location = value; }
            }
            public string note
            {
                get { return event_note; }
                set { event_note = value; }
            }

            public Event(int p_uid, int p_id, int p_event_id, string p_note, string p_loc, string p_sd, string p_ed, bool p_alarm, string[] p_pn, string p_t, string p_color, bool p_perm, int p_aid, string p_asd, string p_aed, int p_ar)
                : base(p_uid, p_id, p_sd, p_ed, p_alarm, p_pn, p_color, p_perm, p_aid, p_asd, p_aed, p_ar)
            {
                event_location = p_loc;
                event_type_id = p_event_id;
                event_note = p_note;
                event_type_name = p_t;
            }
        }

        public class Alarm
        {
            private int alarm_id;
            private string alarm_start_date;
            private string alarm_end_date;
            private int alarm_recurrence;

            public int id
            {
                get { return alarm_id; }
                set { alarm_id = value; }
            }
            public string start_date
            {
                get { return alarm_start_date; }
                set { alarm_start_date = value; }
            }
            public string end_date
            {
                get { return alarm_end_date; }
                set { alarm_end_date = value; }
            }
            public int recurrence
            {
                get { return alarm_recurrence; }
                set { alarm_recurrence = value; }
            }

            public Alarm(int p_id, string p_sd, string p_ed, int p_r)
            {
                alarm_id = p_id;
                alarm_start_date = p_sd;
                alarm_end_date = p_ed;
                alarm_recurrence = p_r;
            }
        }

        public class User {
            public int userid;
            public string username;
            public string password;
            public string email;

            public Hashtable appointment;
            public Hashtable birthday;
            public Hashtable events;
            //public Hashtable alarm;
            public Hashtable todays_appointment;
            public Hashtable todays_birthday;
            public Hashtable todays_events;
            //public Hashtable todays_alarm;
            public Hashtable contact;

            public User(int id, string name, string passw, string u_email) {
                userid = id;
                username = name;
                password = passw;
                email = u_email;

                appointment =new Hashtable();
                birthday = new Hashtable();
                events = new Hashtable();
                todays_appointment = new Hashtable();
                todays_birthday = new Hashtable();
                todays_events = new Hashtable();
                contact = new Hashtable();
            }
        }
        public class Group
        {
            public int groupId;
            public string groupName;
            public Hashtable members;
            

            public Group(int id, string name)
            {
                groupId = id;
                groupName = name;

                members = new Hashtable();
            }
        }

    //    public class Contact
    //{
    //    private int contact_id;
    //    private string contact_name;
    //    private string contact_surname;
    //    private string contact_address;
    //    private string contact_fax_no;
    //    private string contact_mobil_tel;
    //    private string contact_email;
    //    private string contact_home_tel;
    //    private string contact_notes;
    //    private string contact_type;

    //    public int id
    //    {
    //        get { return contact_id; }
    //        set { contact_id = value; }
    //    }
    //    public string name
    //    {
    //        get { return contact_name; }
    //        set { contact_name = value; }
    //    }
    //    public string surname
    //    {
    //        get { return contact_surname; }
    //        set { contact_surname = value; }
    //    }
    //    public string address
    //    {
    //        get { return contact_address; }
    //        set { contact_address = value; }
    //    }
    //    public string fax_no
    //    {
    //        get { return contact_fax_no; }
    //        set { contact_fax_no = value; }
    //    }
    //    public string home_tel
    //    {
    //        get { return contact_home_tel; }
    //        set { contact_home_tel = value; }
    //    }
    //    public string mobil_tel
    //    {
    //        get { return contact_mobil_tel; }
    //        set { contact_mobil_tel = value; }
    //    }
    //    public string email
    //    {
    //        get { return contact_email; }
    //        set { contact_email = value; }
    //    }
    //    public string notes
    //    {
    //        get { return contact_notes; }
    //        set { contact_notes = value; }
    //    }
    //    public string type
    //    {
    //        get { return contact_type; }
    //        set { contact_type = value; }
    //    }

    //    public Contact(int p_id, string p_n, string p_sn, string p_a, string p_f, string p_ht, string p_mt, string p_e, string p_not, string p_t)
    //    {
    //        contact_id = p_id;
    //        contact_name = p_n;
    //        contact_surname = p_sn;
    //        contact_address = p_a;
    //        contact_fax_no = p_f;
    //        contact_mobil_tel = p_mt;
    //        contact_email = p_e;
    //        contact_home_tel = p_ht;
    //        contact_notes = p_not;
    //        contact_type = p_t;
    //    }
    //}
}
